<?php
/*
 * Copyright (c) 2022.  Liuhongbin All rights reserved.
 * @domain http://dkyx.cc
 * @author liuhongbin <514660094@qq.com>
 */

namespace app\common\model\wework;

use hiduoke\services\facade\WorkWechatService;

/**
 * 自建应用
 * Class WeworkKfUser
 * @package app\common\model\wework
 * User: liuhongbin
 * Date: 2022-07-20 23:33
 */
class WeworkApps extends WeworkBaseModel
{
    protected $type = array(
        'config'=>'json'
    );


    public function getFormOptions($plaid)
    {
        $apps = $this->where(['plaid'=>$plaid])->select();

        $options[] = [
            'label'=>'无',
            'value'=>0
        ];
        foreach ($apps as $key => $value) {
            $options[] = [
                'label'=>$value['name'],
                'value'=>$value['id']
            ];
        }

        return $options;
    }
}
